package org.jeecg.modules.simulator.factory;

import lombok.Getter;
import lombok.Setter;
import org.jeecg.modules.simulator.jsonot.NumPeopEnStationApiInfo;
import org.jeecg.modules.simulator.jsonot.ODProbabilityApiInfo;
import org.jeecg.modules.simulator.jsonot.PsgStationDistributionInfo;
import org.jeecg.modules.simulator.jsonot.RouteStation;
import org.jeecg.modules.simulator.model.SceneParam;
import org.jeecg.modules.simulator.model.SimulatorParam;
import org.jeecg.modules.simulator.model.line.station.station.Station;
import org.jeecg.modules.simulator.model.line.station.station.TransferStation;
import org.jeecg.modules.simulator.model.train.timeplan.TrainPlanTable;
import org.jeecg.modules.simulator.service.HistoryBizPersonLoaderService;
import org.jeecg.modules.simulator.service.HistoryBizTrainLoaderService;
import org.jeecg.modules.simulator.service.T80RouteHisService;
import org.jeecg.modules.simulator.util.UnitCache;
import org.jeecg.modules.simulator.vo.VirtualTrainSchedularQueryCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program:
 * @description:加载全天的业务数据
 * 1、时刻表数据
 * 2、路径表
 * 3、全天每秒刷卡进站人数
 * 4、各站人员OD分配概率
 * @author: renzhg
 * @create: 2024-10-09 11:01
 **/
@Service
public class LoadAllDayHistory implements LoadHistoryData{
//
////    @Setter
////    SimulatorParam simulatorParam;
//    @Setter
//    String sceneCode;
//
//    public LoadAllDayHistory(HistoryBizTrainLoaderService historyBizTrainLoaderService,
//                             HistoryBizPersonLoaderService historyBizPersonLoaderService){
//        this.historyBizTrainLoaderService=historyBizTrainLoaderService;
//        this.historyBizPersonLoaderService=historyBizPersonLoaderService;
////        this.t80RouteHisService=t80RouteHisService;
//
//    }
//
//
////    全天每秒刷卡进站人数
//    @Getter
//    @Setter
//    Map<String, Map<String, NumPeopEnStationApiInfo>> numPeopEnStationApiInfoMap = new HashMap<>();
//    //全天各站人员OD分配概率,key:定义odID
//    @Getter
//    @Setter
//    Map<String, List<ODProbabilityApiInfo>> odProbabilityApiInfoMap = new HashMap<>();
//
//    //路径表
//    @Getter
//    Map<String, List<RouteStation>> t80RouteHisMap = new HashMap<>();
//
//    //时刻表
//    @Getter
//    Map<String, List<TrainPlanTable>> trainPlanTableMapByLine = new HashMap<>();
//
//
////region service
//@Setter
//    HistoryBizTrainLoaderService historyBizTrainLoaderService;//历史列车时刻表
//    @Setter
//    HistoryBizPersonLoaderService historyBizPersonLoaderService;//历史人员数据
//
//    T80RouteHisService t80RouteHisService;
////    @Autowired
////    T80RouteHisService t80RouteHisService;
////endregion
//    public void loadEntryStationNum(String sceneCode) {
//        SceneParam sceneparam = UnitCache.sceneParamMap.get(sceneCode);
//        //4、一个时间段内每秒刷卡进站人数
//        historyBizPersonLoaderService.loadNumPeopleEnByEndStation(sceneparam.getSceneDate(),  sceneparam.getEndTimeStr());
//        numPeopEnStationApiInfoMap = historyBizPersonLoaderService.getNumPeopEnStationApiInfoMap();
//    }
//
//
//
//
//
//
//
//    public void loadODAssignPerson(String sceneCode) {
//        SceneParam sceneparam = UnitCache.sceneParamMap.get(sceneCode);
//        //1、各站人员OD分配概率
//        historyBizPersonLoaderService.getRouteStatistics(sceneparam.getSceneDate(), sceneparam.getStartTimeStr(), sceneparam.getEndTimeStr());
//        odProbabilityApiInfoMap = historyBizPersonLoaderService.getOdProbabilityApiInfoMap();
//    }
//
//
////    public void loadT80Route() {
////        t80RouteHisService.load();
////        // 1、人员路径表
////        t80RouteHisMap = t80RouteHisService.getT80RouteHisMap();
////
////    }
//    @Override
//    public void loadHistoryPerson(Map<String, Station> stationMap, Map<String, TransferStation> transferStationMap , String sceneCode) {
////        loadT80Route();//人员路径表
//        historyBizPersonLoaderService.setStationMap(stationMap);
//        historyBizPersonLoaderService.setTransferStationMap(transferStationMap);
//        loadEntryStationNum(sceneCode);
//        loadODAssignPerson(sceneCode);
//
//    }
//
//    @Override
//    public void loadHistroyTrain(Map<String, Station> stationMap,
//                                 Map<String, TransferStation> transferStationMap,
//                                 String sceneCode) {
//        SceneParam sceneparam = UnitCache.sceneParamMap.get(sceneCode);
//
//        historyBizTrainLoaderService.stationMap = stationMap;
//        historyBizTrainLoaderService.setTransferStationMap(transferStationMap);
//
//
//        VirtualTrainSchedularQueryCondition virtualTrainSchedularQueryCondition = new VirtualTrainSchedularQueryCondition();
//        virtualTrainSchedularQueryCondition.setDataDt(sceneparam.getSceneDate());
////        virtualTrainSchedularQueryCondition.setStartTime(sceneparam.getSceneDate()+" "+sceneparam.getStartTimeStr());
////        virtualTrainSchedularQueryCondition.setEndTime(sceneparam.getSceneDate()+" "+sceneparam.getEndTimeStr());
//        historyBizTrainLoaderService.setIsAllDay(true);
//        historyBizTrainLoaderService.setVirtualTrainSchedularQueryCondition(virtualTrainSchedularQueryCondition);
//        historyBizTrainLoaderService.loadTimePlanData();
//
//        trainPlanTableMapByLine = historyBizTrainLoaderService.getTrainPlanTableByLineMap();
//    }
//
//    @Override
//    public Map<String, List<PsgStationDistributionInfo>> getPsgStationDistributionInfoMap() {
//        return Collections.emptyMap();
//    }
}
